<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="http://cdn.bootcss.com/jquery/2.2.1/jquery.js"></script>
</head>
<body>
<div $id="432">
    s
</div>
<script>
    var id = $('div').attr("$id");
    $('div').text(id);
</script>

</body>
</html>